﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Portal/Master/Portal.Master" AutoEventWireup="true"
    CodeBehind="OrderSuccess.aspx.cs" Inherits="Besture.UI.Portal.Pay.OrderSuccess" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Content" runat="server">
    <div class="main">
        <div class="order_top">
            <div class="order_top_body">
                <div class="order_top_content">
                    <img src="../../Resource/images/title1.png" />
                    <p>
                        填写订单</p>
                </div>
                <div class="order_top_xian">
                    <div class="xian">
                    </div>
                </div>
                <div class="order_top_content">
                    <img src="../../Resource/images/title2.png" />
                    <p>
                        核对信息</p>
                </div>
                <div class="order_top_xian">
                    <div class="xian">
                    </div>
                </div>
                <div class="order_top_content">
                    <img src="../../Resource/images/title3.png" />
                    <p>
                        等待确认</p>
                </div>
                <div class="order_top_xian">
                    <div class="xian">
                    </div>
                </div>
                <div class="order_top_content">
                    <img src="../../Resource/images/title4.png" />
                    <p>
                        支付</p>
                </div>
                <div class="order_top_xian">
                    <div class="xian">
                    </div>
                </div>
                <div class="order_top_content">
                    <div class="borr">
                        <img src="../../Resource/images/title5_5.png" />
                    </div>
                    <p class="act">
                        完成</p>
                </div>
            </div>
            <div class="left">
            </div>
            <div class="right">
            </div>
        </div>
        <form>
        <div class="order_main">
            <div class="order_main_top">
                <a href="../Home/Index.aspx">首页</a> > <a href="../Hotel/Product.aspx">酒店列表</a> >
                <asp:Label ID="lblHotelName" CssClass="grog" runat="server"></asp:Label>
            </div>
            <div class="affirm_main">
                <div class="text1">
                    <img src="../../Resource/images/title5_55.png" />&nbsp;&nbsp;支付成功！</div>
                <div class="txt2">
                    您已成功支付￥<asp:Label ID="lblPrice" runat="server"></asp:Label>元</div>
                <div class="text7">
                    提示：您的订单正在处理中，三十分钟后可在酒店查到预订信息。&nbsp;&nbsp;
                    <a href="/Portal/UserCenter/OrderList.aspx">查询订单</a></div>
            </div>
            <div class="pay_foolt">
                <div class="pay_top">
                    酒店推荐</div>
                <div class="pay_foolt_main">
                </div>
                <div class="pay_foolt_main1">
                </div>
            </div>
            <br class="clear" />
            <br class="clear" />
        </div>
        </form>
    </div>
    <script type="text/x-mustache" id="t1">
        {{#items}}
            <div class="pay_content">
                <a href="../Hotel/ProductDetail.aspx?hotelid={{ID}}" class="fleft">
                    <img style="width:109px; height:76px;" src="{{HotelsImage}}" />
                </a>
                <div class="pay_content_con">
                    <span class="grog">{{HotelsName}}</span> <span class="jf"><span>{{Score}}</span> /5分</span>
                    <p>地址：{{Address}}</p>
                    <a href="javascript:CollectHotels({{ID}});" tag="{{ID}}" style="background:url(../../Resource/images/{{IsFav}}) left center no-repeat">收藏</a>
                </div>
            </div>
        {{/items}}
    </script>
    <script type="text/javascript">
        $(document).ready(function () {
            $.ajax({
                type: "POST",
                url: "OrderSuccess.aspx/GetHotelsRecommend",
                contentType: "application/json",
                success: function (msg) {
                    if (msg.d != "") {
                        var dataObj = eval("(" + msg.d + ")");
                        $(".pay_foolt_main").append(Mustache.render($("#t1").html(), dataObj[0]));
                        $(".pay_foolt_main1").append(Mustache.render($("#t1").html(), dataObj[1]));
                    }
                }
            });
        });

        function CollectHotels(id) {
            var fav = 0;
            if ($("a[tag='" + id + "']").css("background").indexOf("fav2") == -1) {
                fav = 1;
            }
            $.ajax({
                type: "POST",
                url: "Product.aspx/CollectHotels",
                data: "{ 'hotelid': " + id + ",'fav':" + fav + "}",
                contentType: "application/json",
                success: function (msg) {
                    if (msg.d == 1) {
                        if ($("a[tag='" + id + "']").css("background").indexOf("fav2") == -1) {
                            $("a[tag='" + id + "']").css("background", "url(../../Resource/images/fav2.png) left center no-repeat");
                        } else {
                            $("a[tag='" + id + "']").css("background", "url(../../Resource/images/fav.png) left center no-repeat");
                        }
                    } else if (msg.d == 0) {
                        alert("请先登录！");
                        window.location.href = "../UserCenter/Login.aspx";
                    } else {
                        alert("收藏失败！");
                    }
                }
            });
        }
    </script>
</asp:Content>
